package com.customview.inputview;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.EditText;

/**
 * Created by bm on 2017/5/17.
 */

public class NoEmojiEditText extends EditText {
    public NoEmojiEditText(Context context) {
        super(context);
        initView();
    }

    public NoEmojiEditText(Context context, AttributeSet attrs) {
        super(context, attrs);
        initView();
    }

    public NoEmojiEditText(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        initView();
    }

    private void initView() {
//        setFilters(new InputFilter[]{new InputFilter() {
//            @Override
//            public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
//                for (int index = start; index < end; index++) {
//
//                    int type = Character.getType(source.charAt(index));
//
////                    if (type == Character.SURROGATE) {
////                        return "";
////                    }
//                }
//                return null;
//            }
//        }});
    }

    public boolean isEmpty() {
        return TextUtils.isEmpty(getText());
    }

    @Override
    public boolean performClick() {
        return super.performClick();
    }
}
